package com.example.demo.service;

import com.example.demo.mapper.BlogInfoMapper;
import com.example.demo.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {

    @Autowired
    private BlogInfoMapper blogInfoMapper;

    public List<BlogInfo> getBlogLists(){
      List<BlogInfo> blogs =  blogInfoMapper.getBlogLists();
      if(blogs==null){
          return null;
      }
      return blogs;
    }
    public BlogInfo getBlogInfo(Integer id){
        BlogInfo blogInfo = new BlogInfo();
      return   blogInfoMapper.getBlogInfo(id);
    }
}
